package com.dongdongshop.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

@Configuration
public class FreemarkerConfig {


    @Value("${freemarker.templateLoaderPath}")
    private String templateLoaderPath;

    @Value("${freemarker.defaultEncoding}")
    private String defaultEncoding;

    @Bean
    public FreeMarkerConfigurer FreeMarkerConfigurer(){
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        configurer.setTemplateLoaderPath(templateLoaderPath);
        configurer.setDefaultEncoding(defaultEncoding);
        return configurer;
    }
}
